package com.a3dweijing.wetouch2.Activity;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;


import com.a3dweijing.wetouch2.bean.VideoType;
import com.a3dweijing.wetouch2.fragment.PartitionVideoFragment;

import java.util.List;

/**
 * Created by Yxd on 2017/10/27.
 */

public class PartitionViewpagerAdapter extends FragmentPagerAdapter {
    List<VideoType> videoTypes;


    public PartitionViewpagerAdapter(FragmentManager fm, List<VideoType> videoTypes) {
        super(fm);
        this.videoTypes = videoTypes;
    }

    @Override
    public Fragment getItem(int position) {
        return PartitionVideoFragment.newinstance(videoTypes.get(position).getWc_type_id());
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
//        super.destroyItem(container, position, object);
    }
    @Override
    public int getCount() {
        return videoTypes.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return videoTypes.get(position).getWc_type_name();
    }
}
